#!/bin/bash

source src/conf/config.conf

cd $tftp_dir
echo " Downloading IPcop ..."

mkdir -p iso
mkdir -p ipcop

wget -q -c http://garr.dl.sourceforge.net/project/ipcop/IPCop/IPCop%202.0.3/ipcop-2.0.3-install-netboot.i486.tgz && gunzip ipcop-2.0.3-install-netboot.i486.tgz && tar -xvf ipcop-2.0.3-install-netboot.i486.tar

wget -q -c http://netcologne.dl.sourceforge.net/project/ipcop/IPCop/IPCop%202.0.3/ipcop-2.0.3-install-cd.i486.iso -O ipcop.iso
mount -o loop ipcop.iso  iso/
cp iso/ipcop-2.0.3.tar.gz ipcop/


mv ipcop/ LINUX/
mv ipcop-2.0.3-install-netboot.i486.tar tars/
umount iso/
mv ipcop.iso tars/

cd LINUX/ipcop/2.0.3/i486/
rm README-netboot.i486 && rm memtest && rm pxelinux.0


cat >> pxelinux.cfg/linux << EOF

TIMEOUT 5000
DISPLAY LINUX/ipcop/2.0.3/i486/message
PROMPT 1
DEFAULT install
menu include pxelinux.cfg/graphics.conf
MENU BACKGROUND pxelinux.cfg/background.png

F1 LINUX/ipcop/2.0.3/i486/f1.txt
F2 LINUX/ipcop/2.0.3/i486/f2.txt
F3 LINUX/ipcop/2.0.3/i486/f3.txt

        label INSTALL IPCOP FIREWALL 
	menu label INSTALL IPCOP FIREWALL
            KERNEL LINUX/ipcop/2.0.3/i486/vmlinuz
  APPEND mode=install initrd=LINUX/ipcop/2.0.3/i486/instroot.img loglevel=4 ipcopboot=net
  IPAPPEND 3
 
	TEXT HELP
       Install IPCop Firewall
        ENDTEXT

 EOF
